package com.simpletour.qa.user.service.impl;

import com.simpletour.qa.common.entity.Authority;
import com.simpletour.qa.user.biz.AuthorityBiz;
import com.simpletour.qa.user.service.IAuthorityService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.Set;

/**
 * @author zhaohw
 * @date 2018-06-26 14:58
 */
@Controller
@RequestMapping(value = "rpc/authority")
public class AuthorityServiceImpl implements IAuthorityService {

    @Resource
    private AuthorityBiz authorityBiz;

    @RequestMapping(value = "/role",method = RequestMethod.GET)
    @ResponseBody
    @Override
    public Set<Authority> findAuthorityByRoleIds(@RequestParam String[] roleIds) {
        return authorityBiz.findAuthorityByRoleIds(roleIds);
    }
}
